<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div>1</div>
    <div>2</div>
    <div>3</div>
    <div>4</div>
    <div>5</div>
    <script>
        const div1=document.querySelector('div')
        console.log(div1)

        const divList=document.querySelectorAll('div')
        divList.forEach(div=>{
            div.style.backgroundColor='red'
        })
    </script>
</body>
</html>